home *** CD-ROM | disk | FTP | other *** search
-
-
- function units_cruiser_human_setup()
- units_setup_sea(10,true,true,ENET_EFFECT_GEOMETRY_CRUISERSHADOW)
- end
-
- function units_cruiser_human_resetup()
- units_setup_sea(10,true,false,ENET_EFFECT_GEOMETRY_CRUISERSHADOW)
- end
-
- function units_cruiser_human_select()
- units_select(25,4)
- end
-
- function units_cruiser_human_unselect()
- units_unselect()
- end
-
- function units_cruiser_human_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_cruiser_human_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_cruiser_human_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_cruiser_human_explode()
- units_explode_water1()
- end
-
- function units_cruiser_human_fire1()
- uniSetLife(uniGetLife() / 2.0)
- local unit = uniGetExecutor()
- unit:play3DSound("cruiser gun rotate2.wav",0)
-
- if(unit:getObjectPositionInLocalSpace(uniGetTarget()).z > 0) then
- waitDeath(unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- else
- waitDeath(unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI))
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITTOTARGET,MATH_PI * 0.6,uniGetTarget()))
- end
-
- local recoils = {}
- recoils[0] = unit:getBone(ENBT_GUNRECOILED,0)
- recoils[1] = unit:getBone(ENBT_GUNRECOILED,1)
-
- recoils[0]:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget())
- waitDeath(recoils[1]:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
-
- local firespots = {}
- firespots[0] = unit:getBone(ENBT_FIRE2,0)
- firespots[1] = unit:getBone(ENBT_FIRE2,1)
-
- unit:play3DSound("cruiser dot fire.wav",0)
- firespots[0]:addSimpleEffect(ENET_EFFECT_CRUISERSHOT_FLY):executeCommand(ENC_FIRE1)
- local lightspotstat1 = firespots[0]:addSimpleEffect(ENET_EFFECT_CRUISER_LIGHTSPOT)
- local shot2 = firespots[0]:addSimpleEffect(ENET_EFFECT_PS_CRUISERSHOT)
- recoils[1]:gunRecoil(0,0.3,10)
-
- pause(0.5)
-
- unit:play3DSound("cruiser dot fire.wav",0)
- firespots[1]:addSimpleEffect(ENET_EFFECT_CRUISERSHOT_FLY):executeCommand(ENC_FIRE1)
- local lightspotstat2 = firespots[1]:addBulletEffect(ENET_EFFECT_CRUISER_LIGHTSPOT)
- local shot2_2 = firespots[1]:addSimpleEffect(ENET_EFFECT_PS_CRUISERSHOT)
- recoils[0]:gunRecoil(0,0.3,10)
-
- shot2:suspendedDestroy(2.5)
- shot2_2:suspendedDestroy(2.5)
- lightspotstat1:suspendedDestroy(2.0)
- lightspotstat2:suspendedDestroy(2.0)
- pause(1.5)
-
- unit:addFireArrow()
- end
-
- function units_cruiser_human_fire2()
- local unit = uniGetExecutor()
- unit:addAnimationToQueue(ENAT_PREPAREFORFIRE1,1)
- unit:addAnimationToQueue(ENAT_FIREPOSITION1,MATH_INFINITY)
- unit:play3DSound("cruiser gun up4.wav",0)
- while(unit:getCurrentAnimation() ~= ENAT_FIREPOSITION1) do pause() end
- unit:play3DSound("cruiser generate field3.wav",0)
- local gt = unit:getBone(ENBT_GUNTOWER,1)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- local firespots = {}
- firespot = unit:getBone(ENBT_FIRE1,0)
- local shotcharge = firespot:addBulletEffect(ENET_EFFECT_PS_CRUISERSHOTCHARGE)
- local lightspotstat = firespot:addBulletEffect(ENET_EFFECT_CRUISER_LIGHTSPOT2)
- shotcharge:setLocalPosition(0,0,-5)
- pause(1.0)
- firespot:addSimpleEffect(ENET_EFFECT_CRUISERSHOT_FLY2):executeCommand(ENC_FIRE2)
- pause(1.0)
- unit:play3DSound("explosion.wav",0)
- shotcharge:suspendedDestroy(4.0)
- lightspotstat:destroy()
- pause(1.0)
- unit:play3DSound("cruiser gun back3.wav",0)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI,uniGetTarget()))
- unit:setCurrentAnimationRepeatCount(0)
- unit:addAnimationToQueue(ENAT_AFTERFIRE1,1)
- unit:addFireArrow()
- end
-
- function units_cruiser_human_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("cruiser moves2.wav",1)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 0.6))
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,80))
- sound:destroy()
- end
-
- -- register functions to unit scriptset - they will be called when specified command arrives to unit
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_MOVE,"units_cruiser_human_move")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_FIRE1,"units_cruiser_human_fire1")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_FIRE2,"units_cruiser_human_fire2")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_SELECT,"units_cruiser_human_select")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_SELECTENEMY,"units_cruiser_human_selectenemy")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_UNSELECT,"units_cruiser_human_unselect")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_SETUP,"units_cruiser_human_setup")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_RESETUP,"units_cruiser_human_resetup")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_DAMAGED,"units_cruiser_human_damaged")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_EXPLODE,"units_cruiser_human_explode")
- registerCommand(ENSCRIPTSET_LEVIATHAN_HUMAN,ENC_HIGHLIGHT,"units_cruiser_human_highlight")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_LEVIATHAN_HUMAN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "leviathan_fnu.rmd"
- desc.ScriptSet = ENSCRIPTSET_LEVIATHAN_HUMAN
- desc.MoveType = ENMOVE_SWIM
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_CRUISERSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "cruiser_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(41)
- unitDesc.group = 1
- unitDesc.order = 5
- unitDesc.unit_res_id = ENET_UNIT_LEVIATHAN_HUMAN
- unitDesc.unit_icon_id = "Sealauncher_alienhuman_h_small_normal.dds"
- unitDesc.active_id = "Sealauncher_alienhuman_h_small_active.dds"
- unitDesc.pressed_id = "Sealauncher_alienhuman_h_small_pressed.dds"
- unitDesc.big_icon_id = "Sealauncher_alienhuman_h_big_normal.dds"
- unitDesc.small_icon_id = "Leviathan_l_human_stats.dds"
- unitDesc.HP = 10
- unitDesc.MP = 40
- unitDesc.WR = 4
- unitDesc.min_WR = 1
- unitDesc.WD = 2
- unitDesc.WR2 = 4
- unitDesc.min_WR2 = 1
- unitDesc.WD2 = 3
- unitDesc.ability = 3
- unitDesc.transport = 0
- unitDesc.value = 10
- unitDesc.race = 0
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "MCRUISERH"
-